package com.ruoyi.training.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.training.util.xuehua.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.training.mapper.A01ResTeacherMapper;
import com.ruoyi.training.domain.A01ResTeacher;
import com.ruoyi.training.service.IA01ResTeacherService;

import javax.annotation.Resource;

/**
 * 师资库Service业务层处理
 * 
 * @author WorrilessGo
 * @date 2025-11-18
 */
@Service
public class A01ResTeacherServiceImpl implements IA01ResTeacherService
{
    @Resource
    private A01ResTeacherMapper a01ResTeacherMapper;

    /**
     * 查询师资库
     * 
     * @param teacherId 师资库主键
     * @return 师资库
     */
    @Override
    public A01ResTeacher selectA01ResTeacherByTeacherId(String teacherId)
    {
        return a01ResTeacherMapper.selectA01ResTeacherByTeacherId(teacherId);
    }

    /**
     * 查询师资库列表
     * 
     * @param a01ResTeacher 师资库
     * @return 师资库
     */
    @Override
    public List<A01ResTeacher> selectA01ResTeacherList(A01ResTeacher a01ResTeacher)
    {
        return a01ResTeacherMapper.selectA01ResTeacherList(a01ResTeacher);
    }

    /**
     * 新增师资库
     * 
     * @param a01ResTeacher 师资库
     * @return 结果
     */
    @Override
    public int insertA01ResTeacher(A01ResTeacher a01ResTeacher)
    {
        a01ResTeacher.setCreateTime(DateUtils.getNowDate());
        String id = String.valueOf(new SnowflakeIdUtils(5, 8).nextId());
        a01ResTeacher.setTeacherId(id);
        return a01ResTeacherMapper.insertA01ResTeacher(a01ResTeacher);
    }

    /**
     * 修改师资库
     * 
     * @param a01ResTeacher 师资库
     * @return 结果
     */
    @Override
    public int updateA01ResTeacher(A01ResTeacher a01ResTeacher)
    {
        a01ResTeacher.setUpdateTime(DateUtils.getNowDate());
        return a01ResTeacherMapper.updateA01ResTeacher(a01ResTeacher);
    }

    /**
     * 批量删除师资库
     * 
     * @param teacherIds 需要删除的师资库主键
     * @return 结果
     */
    @Override
    public int deleteA01ResTeacherByTeacherIds(String[] teacherIds)
    {
        return a01ResTeacherMapper.deleteA01ResTeacherByTeacherIds(teacherIds);
    }

    /**
     * 删除师资库信息
     * 
     * @param teacherId 师资库主键
     * @return 结果
     */
    @Override
    public int deleteA01ResTeacherByTeacherId(String teacherId)
    {
        return a01ResTeacherMapper.deleteA01ResTeacherByTeacherId(teacherId);
    }

    @Override
    public int batchInsertA01ResTeacher(List<A01ResTeacher> list) {
        return a01ResTeacherMapper.batchInsertA01ResTeacher(list);
    }
}
